import request from 'umi-request';

export async function queryBpmProcessList(params) {
  return request(`/hr-ssc/api/api-admin/sysSetings/getBpmDataConfigurationPage`, {
    method: 'post',
    data:params,
    requestType: 'form'
  }).then((res) =>{
    if (res.flag) {
      const data = res.data;
      return {
        current: data.currPage,
        data: data.list,
        pageSize: data.pageSize,
        success: true,
        total: data.totalCount,
      };
    } else {
      return {};
    }
  });
}

export async function saveOrUpdateBpmProcess(params) {
  return request('/hr-ssc/api/api-admin/sysSetings/saveOrUpdateBpmDataConfiguration', {
    method: 'post',
    data:params,
    requestType: 'form'
  }).then((res) => {
    return res;
  });
}

export async function deleteBpmProcess(id) {
  return request(`/hr-ssc/api/api-admin/sysSetings/deleteBpmDataConfiguration`, {
    method: 'delete',
    params:{id},
  }).then((res) => {
    return res;
  });
}
